package com.retirement.quartz.task;

import com.retirement.common.core.domain.entity.SysUser;
import com.retirement.common.utils.DateUtils;
import com.retirement.csd.domain.OdsHealth;
import com.retirement.csd.mapper.OdsHealthMapper;
import com.retirement.csd.mapper.OdsOrderMapper;
import com.retirement.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.retirement.common.utils.StringUtils;

import java.util.List;

/**
 * 定时任务调度测试
 *
 * @author ruoyi
 */
@Component("ryTask")
public class RyTask
{
    @Autowired
    private OdsHealthMapper odsHealthMapper;

    @Autowired
    private SysUserMapper userMapper;



    public void ryNoParams()
    {
        SysUser user = new SysUser();
        user.setRoleId(2L);
        List<SysUser> oldList = userMapper.selectUserListAll(user);
        OdsHealth odsHealth = new OdsHealth();
        for (SysUser sysUser : oldList) {
            odsHealth.setUserId(sysUser.getUserId());
            odsHealth.setRecordDate(DateUtils.getNowDate());
            odsHealth.setUserName(sysUser.getUserName());
            odsHealthMapper.insertOdsHealth(odsHealth);
        }
    }
}
